package com.gexiao.queue;

import org.springframework.web.context.request.async.DeferredResult;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedDeque;

public class DeferredQueue {
    private static Queue<DeferredResult> queue = new ConcurrentLinkedDeque<>();

    public static void save(DeferredResult deferredResult) {
        queue.add(deferredResult);
    }

    public static DeferredResult get() {
        return queue.poll();
    }
}
